Repository navigation
html_report: place repeat_group as the repeat level (#642) - #643
Merged
Merged
Conversation
html_report, plots and plots_of_data refused group_cols=("condition",
"repeat_group"), the groups MorphoFeature's end-to-end notebook passes
(section 4), with "group_cols [...] hold ['repeat_group'], which the figure
does not place", so the coverage page failed on every run with repeat
groups.
One shared notion of the figures' biological-repeat level,
_repeat_groups.repeat_level(group_cols): repeat_group when the analysis
groups name it, else biological_repeat; both are refused, since a figure
has one repeat level and keeping the folder label apart beside the repeat
group would split or pair repeats by folder. plots._layout places it (and
pools it with repeat_col=None), the pairwise matrix pairs by it, the HTML
report's interactive figure reads it and the figure's words name it as a
biological repeat. Nothing falls back to biological_repeat; the
biological_repeat path is unchanged.
Fixes #642
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G3qp9AxjpGPw9xfWAUJNqc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #642
Problem
html_report(throughplotsandplots_of_data) raisedValueError: group_cols [...] hold ['repeat_group'], which the figure does not placewhen givengroup_cols=("condition", "repeat_group"). Those are the groups MorphoFeature's end-to-end notebook passes in section 4 (default_groups). As a result, the coverage page failed on every run that has repeat groups.Design
One shared notion of "the repeat column":
_repeat_groups.repeat_level(group_cols)returnsrepeat_groupwhen the analysis groups name it, elsebiological_repeat(the current behaviour). Every place in the figure and HTML code that hard-codedbiological_repeatas the repeat level now reads it:plots._layoutplaces the level, labelled by its values. Withrepeat_col=Noneit pools the level on request.plots_pairwise.pairwise_contrastspairs by the level._html_plotly._observations(the interactive copy of the figure) reads it._plots_textnamesrepeat_groupas "biological repeat", the same asbiological_repeat.The clusters' output key stays
biological_repeat(the level's name incluster_summaries, the CSVs and the page's script).Both columns in
group_cols: refused with aValueErrorthat names the fix (leavebiological_repeatout). A figure has one repeat level, and keeping the folder label apart beside the repeat group would split or pair repeats by folder label. Nothing falls back tobiological_repeatwithout a word.The
biological_repeatpath is unchanged. Inside the workflows, the tables are already paired by repeat group (BLOCKER: confirmed biological-repeat pairing is lost; contrasts pair by folder label #617), so("condition", "biological_repeat")and("condition", "repeat_group")draw the same clusters and the same numbers (tested).The remaining
biological_repeatreferences in the HTML code work on report results (on paired tables) or on the user's own table metadata. None of them is the figure's repeat level, so they are unchanged.Tests (
tests/test_figure_repeat_level.py, 9 tests)repeat_levelcovers its three cases plus the refusal when both columns are given.plots_of_datawith("condition", "repeat_group")on crossed folder labels: clusters G1–G3, and each cluster holds its group's cells (drug G1 is folder r3).repeat_col=Nonepools the repeat groups.biological_repeatpath is unchanged, both with explicitgroup_colsand with none.plots_of_data, bypairwise_contrastsand byhtml_report.html_reportwith("condition", "repeat_group")on tables where folder labels and repeat groups differ: the page is written, the clusters and hover labels show G1–G3, and the clusters and pairwise matrix are identical to thebiological_repeatpath.70d4753): the widget defaults anddefault_groups, thenreportandhtml_reportinto<output>/report.Regression proof: on main (
209b9be), 8 of the 9 tests fail. Five fail with the originalValueError, two because of the refusal message, one with[0] == [3]shared repeats, and one with an ImportError (repeat_leveldoes not exist on main). Onlytest_the_biological_repeat_path_is_unchangedpasses on main.Docs:
docs/report/figures.mdandCHANGELOG.mdare updated, and the function index is regenerated.#640 (the workflows example notebook) is out of scope and left as is.
Generated by Claude Code